<template>
<!-- 任务详情 -->
  <div class="info-form">
    <a-collapse v-model:activeKey="activeKey" class="colapase-item">
      <a-collapse-panel key="2">
        <template #header>
          <div class="header-flex" @click.stop>
            <div class="header-left">
              <span class="header-title">与船代确认装载事项</span>
              <div class="header-select">
                <a-select
                    ref="select"
                    v-model:value="value1"
                    style="width: 150px"
                >
                  <a-select-option value="jack">
                    <span :style="{color: '#FA6400', fontSize: '16px'}">进行中</span>
                  </a-select-option>
                  <a-select-option value="lucy">
                    <span :style="{color: '#FA6400', fontSize: '16px'}">已完成</span>
                  </a-select-option>
                  <a-select-option value="Yiminghe">
                    <span :style="{color: '#FA6400', fontSize: '16px'}">回滚至该节点</span>
                  </a-select-option>
                </a-select>
              </div>
              <div class="header-select-more">
                <div class="more-box">
                  <span class="more-title">执行人</span>
                  <div class="more-list">
                    <div class="more-list-item">张三</div>
                    <div class="more-list-item">欧阳三</div>
                    <div class="more-list-item">张三</div>
                  </div>
                  <div>
                    <a-button class="more-suffix" @click.stop="moreAdd">
                      <template #icon>
                        <PlusOutlined/>
                      </template>
                    </a-button>
                  </div>
                </div>
                <div class="more-panel" v-if="moreCheck">
                  <a-checkbox-group  v-model="value2" style="width: 100%">
                    <a-row>
                      <a-col class="custom-checkobox" :span="24" v-for="item in options1" :key="item.value">
                        <a-checkbox :value="item.value">{{item.label}}</a-checkbox>
                      </a-col>
                    </a-row>
                  </a-checkbox-group>
                </div>
              </div>
            </div>
            <div class="header-right">
              <FieldTimeOutlined/>
              <span :style="{paddingLeft: '10px'}">截止时间：2023年12月12日</span>
            </div>
          </div>
        </template>
        <div class="panel-box">
          <div class="panel-title">
            <FlagFilled :style="{color: '#FA6400'}"></FlagFilled>
            <span>任务：给船代发送DI&B/L模板，确认装载事项</span>
          </div>
          <a-form :model="formState" ref="formAdd"
                  labelAlign="left"
                  :label-col="labelCol"
                  :wrapper-col="wrapperCol"
          >
            <a-row :gutter="16">
              <a-col :span="6">
                <div class="form-item-border">
                  <a-form-item label="B/L要求" name="conId" :rules="[{ required: false, message: '请输入' }]">
                    <a-input :bordered="false" v-model:value="formState.conId" placeholder="请输入"/>
                  </a-form-item>
                </div>
              </a-col>
              <a-col :span="6">
                <div class="form-item-border">
                  <a-form-item label="ID要求" name="conId" :rules="[{ required: false, message: '请输入' }]">
                    <a-input :bordered="false" v-model:value="formState.conId" placeholder="请输入"/>
                  </a-form-item>
                </div>
              </a-col>
              <a-col :span="6">
                <div class="form-item-border">
                  <a-form-item label="选择邮件模板" :label-col="{span: 4}" name="conId" :rules="[{ required: false, message: '请输入' }]">
                    <a-input :bordered="false" v-model:value="formState.conId" placeholder="请输入"/>
                  </a-form-item>
                </div>
              </a-col>
              <a-col :span="6">
                <div class="form-item-border">
                  <a-form-item label="收件人" name="conId" :rules="[{ required: false, message: '请输入' }]">
                    <a-input :bordered="false" v-model:value="formState.conId" placeholder="请输入"/>
                  </a-form-item>
                </div>
              </a-col>
            </a-row>
          </a-form>
        </div>
      </a-collapse-panel>
    </a-collapse>
  </div>
</template>

<script setup>
import {ref} from "vue";
import {PlusOutlined, FlagFilled, FieldTimeOutlined} from '@ant-design/icons-vue';
const activeKey = ref(['1'])
const value1 = ref('jack')
const value2 = ref()
const labelStyle = ref({
  color: '#6B7A8B'
})
const options1 = ref([{
  value: '1',
  label: 'Jack',
}, {
  value: '2',
  label: 'Lucy',
}, {
  value: '3',
  label: 'Yiminghe',
}]);
const labelCol = ref(
    {
      style: {
        width: '60px'
      },
    },
)

const wrapperCol = ref({
  span: 22
})
const formState = ref({
  conId: ''
})
const moreCheck = ref(false)
const moreAdd = () => {
  moreCheck.value = !moreCheck.value
  console.log('点击了')
}
const moreName = () => {}
const showCollapse = () => {}
</script>

<style lang="scss" scoped>
.info-form {
  margin-top: 15px;
}
.colapase-item {
  margin-top: 25px;
  background-color: #F5F8FA;
  font-size: 18px;
  .header-flex {
    display: flex;
    color: #2C3749;
    justify-content: space-between;
    width: 100%;
    .header-left {
      display: flex;
    }
    .header-right {
      margin-top: 5px;
      color: #6B7A8B;
      font-size: 16px;
    }
    .header-title {
      font-size: 16px;
      margin-top: 2px;
      color: #2C3749;
      font-weight: bold;
    }
    .header-subtitle{
      font-size: 16px;
      padding: 0 24px;
      line-height: 30px;
    }
    .header-select {
      margin: 0 24px;
    }
    .header-select-more {
      color: #2C3749;
      border: 1px solid #dcdee0;
      border-radius: 2px;
      background: #fff;
      .more-box {
        display: flex;
        padding: 0 12px;
        .more-title {
          font-size: 14px;
          line-height: 30px;
        }
        .more-list {
          display: flex;
          padding: 0 10px;
          &-item {
            color: #6B7A8B;
            font-size: 14px;
            padding: 0 10px;
            line-height: 30px;
          }
        }
        .more-suffix {
          color: #F5001D;
        }
      }
      .more-panel {
        margin-top: 10px;
        background: #fff;
        padding: 10px 18px;
        border: 1px solid #dcdee0;
        border-radius: 3px;
        box-shadow: 0px 2px 8px 0px rgba(200,201,204,0.50);
        position: fixed;
        z-index: 1000;
        height: 200px;
        overflow-y: scroll;
        text-align: left;
      }

    }
  }
  .panel-box {
    .panel-title {
      text-align: left;
      margin-bottom: 20px;
      span {
        padding: 0 5px;
        color: #2C3749;
        font-size: 16px;
      }
    }
  }

}
</style>
